
#!/bin/bash

# mongodb仓库源
cat > /etc/yum.repos.d/mongodb-org-4.4.repo <<EOF
[mngodb-org]
name=MongoDB Repository
baseurl=http://mirrors.aliyun.com/mongodb/yum/redhat/7Server/mongodb-org/4.4/x86_64/
gpgcheck=0
enabled=1
EOF

# 更新yum源
yum update

# 安装mongodb
yum -y install mongodb-org
# 开启服务
systemctl start mongod.service
# 开机启动
systemctl enable mongod.service


